for a in range(1,10):
    for b in range(1,a+1):
        print('{}*{}={:<3}'.format(a,b,a*b),end='')
    print('')
print('='*70)
for a in range(9,0,-1):
    for b in range(1,a+1):
        print('{}*{}={:<3}'.format(a,b,a*b),end='')
    print('')
print('='*70)

a = 1
while a<=9:
    b = 1
    while b<=a:
        print('{}*{}={:<4}'.format(a,b,a*b),end='')
        b = b+1
    a = a+1
    print('')
print('='*70)
a = 9
while a >= 1:
    b = 1
    while b <= a:
        print('{}*{}={:<4}'.format(a,b,a*b),end='')
        b = b+1
    a = a-1
    print('')
print('='*70)

